#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
void check(char S[1001], int n)
{
	char* pa = S;
	char* pb = S + n - 2;
	int temp = 1;
	while (*pb == 'q' || *pb == 'b' || *pb == 'l')
	{
		pb--;
	}
	while (pa < pb)
	{
		if (*pb == *pa)
		{
			pa++;
			pb--;
		}
		else
		{
			temp = 0;
			break;
		}
	}
	if (temp)
	{
		printf("Yes\n");
	}
	else
	{
		printf("No\n");
	}
}
int main()
{
	int T;
	scanf("%d", &T);
	getchar();
	if (T >= 1 && T <= 10)
	{
		while (T)
		{
			char S[10001] = { 0 };
			fgets(S, 1001, stdin);
			int n = strlen(S);
			check(S, n);
			T--;
		}
	}
	return 0;
}